import 'package:flutter/material.dart';
import 'package:my_flutter_core/widgets/list_tile_navigate_next_icon.dart';

/// This is a [ListTile] with a [value] which is a list of widget next to the navigation icon.
class ListTileValueTrailing extends StatelessWidget {
  const ListTileValueTrailing({super.key, this.value});

  // This is the list of widget will be displayed next to navigation icon.
  final List<Widget>? value;

  @override
  Widget build(BuildContext context) {
    final preparedValue = <Widget>[];

    if (value != null) {
      preparedValue.addAll(value!);
    }

    preparedValue.addAll([
      const SizedBox(width: 10.0),
      const ListTileNavigateNextIcon(),
    ]);

    return Row(
      mainAxisSize: MainAxisSize.min,
      children: preparedValue,
    );
  }
}
